package com.example.multilpeDataSource.dao;

import com.example.multilpeDataSource.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

/**
 * @author wangzhendong
 * @data 2020-02-08 14:06
 */
@Mapper
@Component
public interface UserMapper {

    @Select("select id,name from user where id = #{id}")
    User findById(@Param("id") Integer id);

    @Insert("insert into user(id, name) values (#{id}, #{name})")
    Integer add(@Param("id") Integer id, @Param("name") String name);
}
